/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.base.manager.impl;

import com.xy.biz.base.dao.EquipmentDao;
import com.xy.biz.base.domain.bo.EquipmentBO;
import com.xy.biz.base.domain.converter.EquipmentConverter;
import com.xy.biz.base.domain.query.EquipmentQuery;
import com.xy.biz.base.manager.EquipmentManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 *
 *
 * @author yzh
 * @date 2021-4-13
 */
@Service
public class EquipmentManagerImpl implements EquipmentManager {

	@Autowired
	private EquipmentDao equipmentDao;

	@Override
	public int saveEquipment(EquipmentBO equipmentBO) {
		return equipmentDao.saveEquipment(EquipmentConverter.toPO(equipmentBO));
	}

	@Override
	public int saveAllEquipment(Collection<EquipmentBO> collection) {
		return equipmentDao.saveAllEquipment(EquipmentConverter.toPO(collection));
	}

	@Override
	public int updateEquipment(EquipmentBO equipmentBO) {
		return equipmentDao.updateEquipment(EquipmentConverter.toPO(equipmentBO));
	}

	@Override
	public int deleteEquipment(Long equipmentId) {
		return equipmentDao.deleteEquipment(equipmentId);
	}

	@Override
	public EquipmentBO getEquipment(Long equipmentId) {
		return EquipmentConverter.fromPO(equipmentDao.getEquipment(equipmentId));
	}

	@Override
	public List<EquipmentBO> listEquipmentById(Collection<Long> collection) {
		return EquipmentConverter.fromPO(equipmentDao.listEquipmentById(collection));
	}

	@Override
	public List<EquipmentBO> listEquipment(EquipmentQuery query) {
		return EquipmentConverter.fromPO(equipmentDao.listEquipment(query));
	}

	@Override
	public int lockup(Collection<Long> collection) {
		return equipmentDao.lockup(collection);
	}

	@Override
	public int unlock(Collection<Long> collection) {
		return equipmentDao.unlock(collection);
	}

	@Override
	public int countEquipment(EquipmentQuery query) {
		return equipmentDao.countEquipment(query);
	}

}
